package biolabs.core;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Marks a method of a bio-object that is called after this bio-object
 * has taken part in a designated interaction initiated from its parent.
 *
 * <p>Don't confuse with {@link ResultHandler}, which is used
 * to handle the interaction result by the initiator.</p>
 *
 * <p>The interaction delegate previously returned by this bio-object, now
 * containing the interaction outcome with respect to this bio-object, will
 * be passed as the only argument to the method marked by this annotation.</p>
 *
 * <p>All {@code @OutcomeHandler}s known at compile-time will be invoked
 * to handle the outcome of an interaction, in no particular order.</p>
 *
 * @author Tomas Mikula
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface OutcomeHandler {
	Class<?>[] action();
	String[] typeParamRefs() default {};
}
